#include <iostream>
#include <cctype>

int main()
{
	int n;
	int min = INT_MAX, max = INT_MIN, sum = 0;
	int digit;

	std::cin >> n;

	while (n--)
	{
		std::cin >> digit;

		if (digit < min)
			min = digit;

		if (digit > max)
			max = digit;
		
		sum += digit;
	}

	std::cout << max << '\n' << min << '\n' << sum << std::endl;

	return 0;
}